﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>เพิ่มผู้ใช้งาน</title>
</head>
<style>
#header{
	height: 32px;
	margin-right: 20px;
	margin-left: 2px;
}

#header_titile{
	float: left;
}

#main{
	width:800px;
	margin: 0 auto 0 auto;
	border: 1px solid #E5E5E5;
	padding: 26px 24px 46px;
}

#user_info{
	float: right;
	font-size: 14px;
	/*line-height: 26px;*/
	height: 25px;
	position: relative;
/*	z-index: 49; */
	border-style: solid;
	border-width: 0;
	/* margin-top: 3px; */
	padding: 0 2px 0 6px;
	display:block;
}

body{
	font-family:tahoma;
	font-size:14px;	
}
</style>
<body>
<div id="main">
<div id="header" >
	-> แก้ไขผู้ใช้งานในระบบ
	<div id="user_info">สวัสดีคุณผู้ใช้ <?php echo $_SESSION['username']; ?><?php echo " (".$_SESSION['user_level'].")"; ?> <a href="<?php echo site_url('webadmin/logout') ?>">ออกจากระบบ</a></div>
</div>

<br />
<?php echo form_open("user/update_user/".$row->username); ?>
<table border="1" cellspacing="0">
  <tr >
    <th width="200">รายการ</th>
    <th width="200">ชื่อ นามสกุล</th>
    </tr>
  <tr>
  	<td>ชื่อผู้ใช้</td>
    <td><input type="text" name="user_id" class="input" value="<?php echo $row->username; ?>" size="20" tabindex="10" />
    	<?php echo form_error("user_id", "<br/><font color='error'>","</font>"); ?></td>
  </tr>
  <tr>
    <td>รหัสผ่าน</td>
    <td><input type="password" name="user_password" class="input" value="<?php echo $row->password; ?>" size="20" tabindex="10" />
    	<?php echo form_error("user_password", "<br/><font color='error'>","</font>"); ?></td>
  </tr>
  <tr>
    <td>รหัสผ่านอีกครั้ง</td>
    <td><input type="password" name="user_password2" class="input" value="<?php echo $row->password; ?>" size="20" tabindex="10" />
    	<?php echo form_error("user_password2", "<br/><font color='error'>","</font>"); ?></td>
  </tr>
  <tr>
    <td>email</td>
    <td><input type="text" name="user_email" class="input" value="<?php echo $row->email; ?>" size="20" tabindex="10" />
    	<?php echo form_error("user_email", "<br/><font color='error'>","</font>"); ?></td>
  </tr>
  <tr>
    <td>สิทธิ</td>
    <td><select name="user_level">
          <option value="editor" <?php if ($row->level == "editor" ) echo "selected='selected' ";  ?> >editor</option>
          <option value="reader" <?php if ($row->level == "reader" ) echo "selected='selected' ";  ?> >reader</option>
          <option value="admin" <?php if ($row->level == "admin" ) echo "selected='selected' ";  ?> >admin</option>
        </select>
    </td>
  </tr>
</table>
<input type="submit" name="btsubmit" value="แก้ไข" />
<a href="<?php echo site_url('user') ?>">ยกเลิก</a>
<?php echo form_close() ?>
<?php 
	echo "<font color='error'>";
	echo $err_msg;
	echo "</font>";
?>
</div>
</body>
</html>
